Text function rule examples

Text function rule examples

Text functions are used with text variables to combine text strings and to extract parts of text strings.

Be sure to use the exact syntax for these functions including spacing and parentheses as specified below. Note that text functions are case-insensitive.

Rule examples

Function Example rule Inputs Outputs Further information
Contains

the account may be a benefit account if

Contains(the account name, "benefit")

the account name: "Special Benefits" the account may be a benefit account = true Check if a text string contains a particular substring
StartsWith

the person should be represented if

StartsWith(the person's name, "Sir")

the person's name: "Sir Lancelot" the person should be represented = true Check if a text string contains a particular substring at the start of the string
EndsWith

the product uses the ascending sort code if

EndsWith(the product code, "-ASC")

the product code: "B421-A3N-ASC" the product uses the ascending sort code = true Check if a text string contains a particular substring at the end of the string
IsNumber

the postcode is a valid Australian postcode if

IsNumber(the postcode) and Length(the postcode) = 4

the postcode: "2612" the postcode is a valid Australian postcode = true Check if a text string is a number
Length

the product code is valid if

Length(the product code) > 8

the product code: "123456789" the product code is valid = true Find the length of a text string
Concatenation

the screen heading variable for the person = the concatenation of the person's first name & ", " & the person's age & ", " & the person's occupation

the person's first name: William

the person's age: 20

the person's occupation: Student

the screen heading variable for the person = "William, 20, Student" Combine multiple text strings into a single text variable
Substring

customer reference = Substring(customer name, 4, 4)

customer name: "maryjane"

customer reference = "jane" Extract part of a text string
Text

the customer's age text = Text(the customer's age)

the customer's age: 25 the customer's age text = "25" Convert a number or date into a text string

 

TIP: The localized syntax for these functions may be viewed: